package com.cph.usercenter.controller.user;

import com.cph.usercenter.domain.entity.user.User;
import com.cph.usercenter.service.user.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName UserController
 * @Description TODO
 * @Author cph
 * @Date 2020/9/25 17:37
 * @Version 1.0
 */
@RestController
@RequestMapping("/users")
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping("/{id}")
    public User findById (@PathVariable Integer id){
        return userService.findById(id);
    }
}
